 package tools.packet;

 import client.inventory.Item;
 import handling.opcode.SendPacketOpcode;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import tools.data.output.MaplePacketLittleEndianWriter;








 public class WhisperPacket
 {
/*  18 */   private static final Logger log = LogManager.getLogger(WhisperPacket.class);


   public static byte[] getWhisper(String sender, int channel, String text) {
/*  22 */     return getWhisper(false, sender, channel, text, null);
   }


   public static byte[] getWhisper(boolean ItemWhisper, String sender, int channel, String text, Item item) {
/*  27 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/*  28 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/*  30 */     mplew.writeShort(SendPacketOpcode.WHISPER.getValue());
/*  31 */     mplew.write(18);
/*  32 */     mplew.writeMapleAsciiString(sender);
/*  33 */     mplew.writeInt(0);
/*  34 */     mplew.writeShort(channel - 1);
/*  35 */     mplew.writeMapleAsciiString(text);
/*  36 */     mplew.writeMapleAsciiString(sender);
/*  37 */     mplew.writeMapleAsciiString(text);
/*  38 */     mplew.writeInt(0);
/*  39 */     mplew.writeInt(0);
/*  40 */     mplew.write(-1);
/*  41 */     mplew.writeInt(0);
/*  42 */     mplew.write(0);
/*  43 */     if (ItemWhisper) {
/*  44 */       PacketHelper.addItemInfo(mplew, item);
     }
/*  46 */     return mplew.getPacket();
   }




   public static byte[] getWhisperReply(String target, byte reply) {
/*  53 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/*  54 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/*  55 */     mplew.writeShort(SendPacketOpcode.WHISPER.getValue());
/*  56 */     mplew.write(10);
/*  57 */     mplew.writeMapleAsciiString(target);
/*  58 */     mplew.write(reply);

/*  60 */     return mplew.getPacket();
   }

   public static byte[] getWhisperReply(String target, byte reply, String name) {
/*  64 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/*  65 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/*  66 */     mplew.writeShort(SendPacketOpcode.WHISPER.getValue());
/*  67 */     mplew.write(10);
/*  68 */     mplew.writeMapleAsciiString(target);
/*  69 */     mplew.write(reply);
/*  70 */     mplew.writeMapleAsciiString(name);
/*  71 */     mplew.writeMapleAsciiString(target);
/*  72 */     mplew.writeMapleAsciiString(name);
/*  73 */     mplew.writeInt(0);

/*  75 */     return mplew.getPacket();
   }

   public static byte[] getFindReplyWithMap(String target, int mapid, boolean buddy) {
/*  79 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/*  80 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/*  82 */     mplew.writeShort(SendPacketOpcode.WHISPER.getValue());
/*  83 */     mplew.write(buddy ? 72 : 9);
/*  84 */     mplew.writeMapleAsciiString(target);
/*  85 */     mplew.write(1);
/*  86 */     mplew.writeInt(mapid);

/*  88 */     return mplew.getPacket();
   }

   public static byte[] getFindReply(String target, int channel, boolean buddy) {
/*  92 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/*  93 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/*  95 */     mplew.writeShort(SendPacketOpcode.WHISPER.getValue());
/*  96 */     mplew.write(buddy ? 72 : 9);
/*  97 */     mplew.writeMapleAsciiString(target);
/*  98 */     mplew.write(3);
/*  99 */     mplew.writeInt(channel - 1);

/* 101 */     return mplew.getPacket();
   }

   public static byte[] getFindReplyWithCS(String target, boolean buddy) {
/* 105 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/* 106 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 108 */     mplew.writeShort(SendPacketOpcode.WHISPER.getValue());
/* 109 */     mplew.write(buddy ? 72 : 9);
/* 110 */     mplew.writeMapleAsciiString(target);
/* 111 */     mplew.write(2);
/* 112 */     mplew.writeInt(-1);

/* 114 */     return mplew.getPacket();
   }

   public static byte[] getFindReplyWithMTS(String target, boolean buddy) {
/* 118 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/* 119 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 121 */     mplew.writeShort(SendPacketOpcode.WHISPER.getValue());
/* 122 */     mplew.write(buddy ? 72 : 9);
/* 123 */     mplew.writeMapleAsciiString(target);
/* 124 */     mplew.write(0);
/* 125 */     mplew.writeInt(-1);

/* 127 */     return mplew.getPacket();
   }
 }


/* Location:              C:\PGX\Server.jar!\tools\packet\WhisperPacket.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */